//引入数据库
const mongoose = require("mongoose");
//创建 Schema 实例化
const Schema = mongoose.Schema;

const UserSchema = new Schema({
    name:{
        type:String,
        required:true //必填项
    },
    email:{
        type:String,
        required:true//必填项
    },
    password:{
        type:String,
        required:true //必填项
    },
    avatar:{
        type:String,
    },
    identity:{
        type:String,
        required:true //必填项
    },
    date:{
        type:Date,
        default:Date.now //创建当前时间
    }
})
//暴露
module.exports = User = mongoose.model("user",UserSchema);
